package com.jlect.swebing.ui.client;

/**
 * This implementation iterate component in cyclic way.
 *
 * @author Sergey Kozmin
 * @since 25.11.2007 0:15:13
 */
public class ChildCyclicFocusTraversalPolicy extends ChildLinearTraversalPolicy {
    public ChildCyclicFocusTraversalPolicy(ComponentsProvider baseComponent) {
        super(baseComponent);
    }

    public GComponent getComponentAfter(GComponent component) {
        GComponent ret = super.getComponentAfter(component);
        return ret != null ? ret : getFirstComponent();
    }

    public GComponent getComponentBefore(GComponent component) {
        GComponent ret = super.getComponentBefore(component);
        return ret != null ? ret : getLastComponent();
    }
}
